<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>物资库存信息</title>
<script src="https://cdn.bootcss.com/jquery/2.2.3/jquery.min.js"></script>
<!-- 引入 echarts.js -->
<script src="echarts/dist/echarts.min.js"></script>
</head>
<body>
	<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
	<div id="main" style="width: 1200px; height: 600px;"></div>
	<script type="text/javascript">
		// 基于准备好的dom，初始化echarts实例
			//将echart初始化到div中
			var myChart=echarts.init(document.getElementById("main"));
	//	console.log("1");
				myChart.setOption({
						title:{text:'物资库存'},
						xAxis:[{type:'category',data:[],axisLabel:{interval:0,rotate:-90}}],
						yAxis:{},
						series:[{type:'bar',data:[]}]
				});
		//		console.log("2");
				$.ajax({
					async: false,
	            	url:"wzkc/getCharts",
	            	type:"get",
	            	dataType:"json",
	            	success:function(data){
	            	//	console.log("3");
	            		myChart.setOption({
	            			xAxis:[{type:'category',data:data.wzname,axisLabel:{interval:0,rotate:-90}}],
	            			series:[{type:'bar',data:data.wznum}]
	            		})
	            	}
				})
	</script>
</body>
</html>